package com.kingdee.shr.base.syssetting.web.dynamic.view.converter;

import com.kingdee.shr.base.syssetting.UIType;

public class UIViewConverterFactory {
	public static IUIViewConverter getUIViewConverter(
			com.kingdee.shr.base.syssetting.UIViewInfo dbUIViewInfo) {
		IUIViewConverter converter = null;

		UIType type = dbUIViewInfo.getType();
		if (UIType.form.equals(type))
			converter = new FormUIViewConverterEx(dbUIViewInfo);
		else if (UIType.list.equals(type))
			converter = new ListUIViewConverterEx(dbUIViewInfo);
		else if (UIType.F7.equals(type))
			converter = new F7UIViewConverter(dbUIViewInfo);
		else if (UIType.wizard.equals(type))
			converter = new WizardUIViewConverter(dbUIViewInfo);
		else if (UIType.search.equals(type))
			converter = new SearchUIViewConverterEx(dbUIViewInfo);
		else if (UIType.dynamicList.equals(type))
			converter = new DynamicListUIViewConverter(dbUIViewInfo);
		else if (UIType.dynamicForm.equals(type))
			converter = new DynamicFormUIViewConverter(dbUIViewInfo);
		else {
			converter = new CoreUIViewConverter(dbUIViewInfo);
		}

		return converter;
	}

	public static IFragmentUIViewConverter getFragmentUIViewConverter(
			com.kingdee.shr.base.syssetting.web.dynamic.model.UIViewInfo baseUIViewInfo) {
		return new FragmentUIViewConverter(baseUIViewInfo);
	}
}
